package com.data.util;

import com.amazonaws.util.json.Jackson;

import java.io.Serializable;

/**
 * @Author Str
 * @Date 2022/4/7 19:42
 * @Description :消息返回
 */
public class Result<T> implements Serializable {
    private Integer code;

    private String msg;

    private T entity;

    public Result(ResultEnum resultEnum) {
        this.code = resultEnum.code();
        this.msg = resultEnum.msg();
    }

    public Result(ResultEnum resultEnum, T entity) {
        this.code = resultEnum.code();
        this.msg = resultEnum.msg();
        this.entity = entity;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getEntity() {
        return entity;
    }

    public void setEntity(T entity) {
        this.entity = entity;
    }
}